﻿using System;
using System.Collections.Generic;
using System.Text;
using ControlPoint.ControlAPI;

namespace ControlTest
{
    class Program
    {
        static void Main(string[] args)
        {
            //Main m = new Main();


            int Port = 8080;
            string path = "web";

            Mono.WebServer.XSPWebSource source = new Mono.WebServer.XSPWebSource(System.Net.IPAddress.Any, 8080);
            Mono.WebServer.ApplicationServer server = new Mono.WebServer.ApplicationServer(source);
            //"[[hostname:]port:]VPath:realpath"
            string cmdLine = Port + ":/:" + path;
            server.AddApplicationsFromCommandLine(cmdLine);
            server.Start(true);

            /*
            //m.ZW();8
            ((ZWaveDimmer)m.Devices["zw:21815248:2:38:0"]).Dim(  50);

            Console.WriteLine("Pressing Enter will turn light off");
            Console.ReadLine();
            ((ZWaveDimmer)m.Devices["zw:21815248:2:38:0"]).Off();
            */

            Console.WriteLine("Pressing Enter will exit");
            Console.ReadLine();
            server.Stop();

            //m = null;
            //Console.ReadLine();
            Console.Clear();
            Environment.Exit(-1);
        }

        public static void Ez() {
     
            Console.ReadLine();
            //ZWaveController c = new ZWaveController("COM4");

        }

    }
}
